﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "Data/CommonEnum.h"
#include "Data/MissionStruct.h"
#include "InMissionWidget.generated.h"

class USingleObjectiveWidget;
UCLASS()
class MISCELLANEOUSPROJECT_API UInMissionWidget : public UUserWidget
{
	GENERATED_BODY()
public:
	virtual void NativeConstruct() override;
	virtual void NativeOnInitialized() override;
public:
	void ConstructWidget(FMissionMaster LCurrentMission);
	UFUNCTION(BlueprintImplementableEvent, Category = "MissionComponent")
	void UpdateObjectives(FMissionMaster LCurrentMission,int32 LCurrentSequence);
	UFUNCTION(BlueprintImplementableEvent, Category = "MissionComponent")
	void ToggleMissionWidget(EToggleVisibility InVisibility, bool InRemove);
	UFUNCTION(BlueprintCallable, Category = "MissionComponent")
	void UpdateSequence(FMissionMaster LCurrentMission, int32 LCurrentSequence);
	UFUNCTION(BlueprintCallable, Category = "MissionComponent")
	void RefreshTexts();
	UFUNCTION(BlueprintCallable, Category = "MissionComponent")
	void ResetInMissionWidget();
	UFUNCTION(BlueprintCallable, Category = "MissionComponent")
	void ConstructInMissionWidget(FMissionMaster LCurrentMission);
	UFUNCTION(BlueprintCallable, Category = "MissionComponent")
	void ToggleVisibility(EToggleVisibility InVisibility, bool InRemove);
	UFUNCTION(BlueprintCallable, Category = "MissionComponent")
	void AddObjective(FObjectives ObjectiveInfo);
	UFUNCTION(BlueprintCallable, Category = "MissionComponent")
	void SetObjectives(FMissionMaster LCurrentMission, int32 LCurrentSequence);
public:
	UPROPERTY(BlueprintReadWrite, EditAnywhere,meta = (BindWidget), Category = "MissionComponent")
	class UVerticalBox* ObjectivesPanel;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, meta = (BindWidget), Category = "MissionComponent")
	class UTextBlock* SequenceTitle;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, meta = (BindWidget), Category = "MissionComponent")
	class UTextBlock* SequenceDescription;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, meta = (BindWidget), Category = "MissionComponent")
	class UTextBlock* TempSequenceDesc;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "MissionComponent")
	TArray<USingleObjectiveWidget*> ObjectiveWidgets;
	UPROPERTY(BlueprintReadWrite, Category = "MissionComponent")
	TArray<FObjectives> CurrentObjectives;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "MissionComponent")
	FMissionMaster CurrentMission;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "MissionComponent")
	int32 CurrentSequence;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "MissionComponent")
	int32 AddedObjective;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "MissionComponent")
	EToggleVisibility ObjectivesVisibility;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "MissionComponent")
	bool CanSwitchObjectives;
	UPROPERTY(BlueprintReadWrite, meta = (ExposeOnSpawn = "true"), EditAnywhere, Category = "MissionComponent")
	TSubclassOf<USingleObjectiveWidget> SingleObjectiveWidget;
};
